// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import vue_res from 'vue-resource'
import App from './App'
import router from './router'
// import vant from 'vant';
import 'vant/lib/index.css';
import '@/assets/css/main.css';
// Vue.use(vant);
Vue.config.productionTip = false
Vue.use(vue_res)
//vant 组件
import { Icon, NavBar, Button, Cell, CellGroup, Tabbar, 
  TabbarItem, Grid, GridItem, Image,List,PullRefresh,
  Row, Col   } from "vant";
Vue.use(Icon).use(Image).use(NavBar);
Vue.use(Button).use(Cell).use(CellGroup);
Vue.use(Tabbar).use(TabbarItem).use(Grid).use(GridItem);
Vue.use(List).use(PullRefresh).use(Row).use(Col);
//自定义控件
import dwcard from '@/components/dwCard';
Vue.use(dwcard)
//全局变量
import global from '@/global/global.js';
Vue.prototype.$G = global
router.beforeEach((to,from,next)=>{
  const $content = document.querySelector('.c_container');
  const scrollTop = $content ? $content.scrollTop : 0;
  from.meta.scrollTop = scrollTop;
  next()
})


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
